import tree
import draw

# df_wine = pd.read_csv('./wine/wine.data', header=None) # 本地加载
# df_wine =  df_wine.drop(index = df_wine[(df_wine[0] == 3)].index.tolist())
# data, labels = df_wine.iloc[:, 1:].values, df_wine.iloc[:, 0].values

fr = open(file='./3.3/wine/wine.data', encoding='utf-8')

data = [inst.strip().split(',') for inst in fr.readlines()]
labels = ['1', '2', '3','4','5','6','7','8','9','10','11','12','13']

Trees = tree.create_tree(data, labels)
print(Trees)

draw.draw_tree(Trees)
